overlay: Make forall() remove-safe
authorTimm Bäder <mail@baedert.org>
Sun, 4 Mar 2018 19:04:43 +0000 (20:04 +0100)
committerTimm Bäder <mail@baedert.org>
Sun, 4 Mar 2018 19:04:43 +0000 (20:04 +0100)
Since this is a GtkContainer, forall will be used to destroy all the
widgets.

gtk/gtkoverlay.c

index 6ec549b010715991a505f3f9f6b3a36ee0681ce1..5d069e359ca6eea2dd975f23340f0f7c06b8123c 100644 (file)
@@ -459,11 +459,14 @@ gtk_overlay_forall (GtkContainer *overlay,
 {
   GtkWidget *child;
 
-  for (child = _gtk_widget_get_first_child (GTK_WIDGET (overlay));
-       child != NULL;
-       child = _gtk_widget_get_next_sibling (child))
+  child = gtk_widget_get_first_child (GTK_WIDGET (overlay));
+  while (child != NULL)
     {
+      GtkWidget *next = gtk_widget_get_next_sibling (child);
+
       (* callback) (child, callback_data);
+
+      child = next;
     }
 }